package com.hopu.dy.service.impl;

import com.hopu.dy.mapper.CollectNoticeMapper;
import com.hopu.dy.pojo.CollectNotice;
import com.hopu.dy.service.ICollectNoticeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CollectNoticeServiceImpl implements ICollectNoticeService {

    @Resource
    private CollectNoticeMapper collectNoticeMapper;

    @Override
    public void createCollectNotice(CollectNotice notice) {
        notice.setCreateTime(new Date());
        collectNoticeMapper.insert(notice);
    }

    @Override
    public List<CollectNotice> getCollectNotices(Long collectedUserId) {
        return collectNoticeMapper.selectByCollectedUserId(collectedUserId);
    }
}
